package com.xcity.game.combat.template;

import com.xcity.game.employee.Clazz;

import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.annotation.Excel;

/**
 * 职业克制
 * @author yang.li
 *
 */
@Excel(value = "combat.xlsx", sheet = 2)
public class ClazzRestrainTemplate extends Template {

	/** 职业（1：战，2：法，3：牧） */
	protected Clazz clazz;

	/** 系数（战、法、牧） */
	protected float[] factors;

	public Clazz getClazz() {
		return clazz;
	}

	public void setClazz(Clazz clazz) {
		this.clazz = clazz;
	}

	public float[] getFactors() {
		return factors;
	}

	public void setFactors(float[] factors) {
		this.factors = factors;
	}

	public float getFactor(Clazz clazz) {
		if (clazz == Clazz.WARRIOR) {
			return factors[0];
		}
		if (clazz == Clazz.MAGE) {
			return factors[1];
		}
		if (clazz == Clazz.PRIEST) {
			return factors[2];
		}
		return 1f;
	}

	@Override
	public void validate() throws TemplateException {}
}
